<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<html >
<head>
    <meta charset="UTF-8">
    <title>Contest Status - Online Judge</title>
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" th:href="@{/css/styles.css}" >
    <script th:src="@{/js/jquery-1.7.2.js}"></script>
    <script th:src="@{/js/gdoj.js}"></script>
</head>
<body>
<div th:replace="common::web-navbar"></div>
<div class="container">
    <div class="content" >
        <div class="content-no-sidebar">
            <div id="nav-content" >
                <a th:href="@{/contest/{contestId}(contestId=${contest.contest_id})}">[[#{contestproblems}]]</a>
                <a th:href="@{/contest/{contestId}/status(contestId=${contest.contest_id})}" class="current">[[#{status}]]</a>
                <a th:href="@{/contest/{contestId}/standings(contestId=${contest.contest_id})}" target="blank">[[#{standings}]]</a>
                <a th:href="'/contest/' + ${contest.contest_id} + '/status/' + ${session.session_username} + '/page/1'" target="blank">[[#{mysubmission}]]</a>
            </div>
            <div class="">
                <table class="status ">
                    <tr class="header">
                        <th  class="id left-item">[[#{statusid}]]</th>
                        <th  class="coder">[[#{author}]]</th>
                        <th  class="title" >[[#{problem}]]</th>
                        <th  class="language">[[#{language}]]</th>
                        <th  class="time">[[#{timeuse}]]</th>
                        <th  class="memory">[[#{memoryuse}]]</th>
                        <th  class="verdict">[[#{status}]]</th>
                        <th  class="date">[[#{submitdate}]]</th>
                    </tr>
                    <tr th:if="${pageInfo.size == 0}"><td class="left-item dark" colspan="10" style="text-align: left;">[[#{no-record}]]</td></tr>
                    <tr th:each="solution,stat : ${pageInfo.list}" th:class="${stat.even}?'dark'">
                        <td class="id left-item">
                            <a th:solutionId="${solution.solution_id}" class="view-source" th:href="@{/view-source/{solution_id}(solution_id=${solution.solution_id})}" title="source" target="_blank" th:text="${solution.solution_id}"></a>
                        </td>
                        <td class="coder ">
                            <img class="mini-avatar" th:src="${solution.user.avatar}"/>
                            <a th:href="@{/profile/{username}(username=${solution.username})}" class="rated-user" th:classappend="'user-rate-' + ${solution.user.rate} + ' user-tip'" th:user="${solution.username}"  th:text="${solution.username}"></a></td>
                        <td class="title">
                           <a th:href="@{/contest/{contestId}/problem/{problemNum}(contestId=${solution.contest_id},problemNum=${solution.contestProblem.num})}" th:text="${solution.contestProblem.num} + '.' + ${solution.contestProblem.title}"></a>
                        </td>
                        <td class="language" th:text="${solution.language_name}"></td>
                        <td class="time" th:id="'time_' + ${solution.solution_id}" th:text="${solution.time} + ' ms'"></td>
                        <td class="memory" th:id="'memory_' + ${solution.solution_id}" th:text="${solution.memory} + ' kb'"></td>
                        <td th:class="'verdict '"
                            th:classappend="${solution.verdict==3?'verdict_ce':(solution.verdict==5?'verdict_ac':((solution.verdict == 1 || solution.verdict == 2 || solution.verdict == 4)?' verdict_prev':(solution.verdict==10?'verdict_pe':'verdict_other')))}"
                            th:id="'status_' + ${solution.solution_id}" th:status="${solution.verdict}" manual="0">
                            <a th:solutionId="${solution.solution_id}" th:id="'a_status_' + ${solution.solution_id}" class="view-source" th:text="${solution.status_description}" th:href="'/view-source/'+${solution.solution_id}" target="_blank"></a>
                            <a th:solutionId="${solution.solution_id}" class="re-judge" title="rejudge this solution">
                                <svg class="re-judge-icon" viewBox="0 0 1024 1024" p-id="11138" width="20" height="20"><path d="M512 972.8a460.8 460.8 0 1 1 0-921.6 460.8 460.8 0 0 1 0 921.6zM304.9472 402.7392h-0.0512l50.4832 34.2016c25.2416-42.496 60.3136-71.2704 90.112-82.5344 45.6704-17.3056 82.944-14.848 122.7776 5.9392 37.2224 16.896 62.6688 48.7424 62.6688 48.7424l-44.5952 25.4976s-15.36 6.3488 2.1504 14.1824c31.8976 18.176 133.376 75.9296 142.6944 80.384 11.2128 5.2224 11.2128-9.5232 11.2128-9.5232V354.304c0-11.008-9.5232-6.2976-9.5232-6.2976l-46.1824 26.3168s-18.0736-28.416-71.68-62.1056c-53.6576-33.6896-135.3728-43.6736-201.8304-8.9088-66.304 34.7136-108.288 99.4304-108.288 99.4304h0.0512z m414.1056 218.5216l-50.432-34.304c-25.2928 42.5984-60.3648 71.3728-90.112 82.6368-45.6704 17.2544-82.944 14.848-122.7776-6.0416-37.2224-16.7936-62.6688-48.64-62.6688-48.64l44.544-25.4976s15.4624-6.4-2.048-14.2336c-31.9488-18.176-133.4272-75.8784-142.7456-80.384-11.2128-5.1712-11.2128 9.5232-11.2128 9.5232v165.376c0 11.008 9.5232 6.2976 9.5232 6.2976l46.1824-26.368s18.0736 28.5184 71.68 62.1568c53.6064 33.6896 135.424 43.7248 201.7792 8.9088 66.304-34.7136 108.3392-99.4304 108.3392-99.4304h-0.0512z" fill="#EF8900" p-id="11139"></path></svg>
                            </a>
                        </td>
                        <td class="date" th:title="${#dates.format(solution.submit_date,'yyyy-MM-dd HH:mm:ss')}" th:text="${solution.friendlySubmitDate}"></td>
                    </tr>
                </table>
            </div>
            <div style="margin:6px 12px;font-size:15px;">
                <div class="left"></div>
                <div class="right">
                    <a th:if="${pageInfo.hasPreviousPage == true}"
                       th:href="'/contest/' + ${contest.contest_id} + '/status/problem' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/' + (${username != null}? ${username} + '/' : '') + 'page/' + ${pageInfo.prePage}">&larr;</a>
                    <a th:if="${pageInfo.firstPage > 1}"
                       th:href="'/contest/' + ${contest.contest_id} + '/status/problem' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/' + (${username != null}? ${username} + '/' : '') + 'page/1'">1</a>
                    <span th:if="${pageInfo.firstPage > 2}"  >...</span>
                    <span th:each="nav:${pageInfo.navigatepageNums}">
                        <a th:href="'/contest/' + ${contest.contest_id} + '/status/problem' + (${problemId != null}? '/' + ${problemId} : '') +
                        '/' + (${username != null}? ${username}  + '/' : '') + 'page/' + ${nav}"
                           th:text="${nav}" th:styleappend="${nav == pageInfo.pageNum} ? 'font-weight: bold;' : ''"></a>
                    </span>
                    <span th:if="${pageInfo.lastPage < pageInfo.pages}" >...</span>
                    <a th:if="${pageInfo.pages > pageInfo.lastPage}"
                       th:href="'/contest/' + ${contest.contest_id} + '/status/problem' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/' + (${username != null}? ${username}  + '/' : '') + 'page/' + ${pageInfo.pages}"
                       th:text="${pageInfo.pages}"></a>
                    <a th:if="${pageInfo.hasNextPage == true}"
                       th:href="'/contest/' + ${contest.contest_id} + '/status/problem' + (${problemId != null}? '/' + ${problemId} : '') +
                       '/' + (${username != null}? ${username}  + '/' : '') + 'page/' + ${pageInfo.nextPage}">&rarr;</a>
                </div>
            </div>
        </div>
    </div>
    <div th:replace="common::web-footer"></div>
    <div th:include="problem/status-pop"></div>
</div>
</body>
</html>
